package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;

import com.sa.ibiz.demo.demo.domain.User;

/**
 * 实体[LoginAccount] 数据对象
 */
@TableName(value = "T_SRFLOGINACCOUNT",resultMap = "LoginAccountResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class LoginAccount extends EntityBase implements Serializable{

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private User user;
    @Dict(dictName = "WorkflowMob_CodeList58CodeList")
    private String appuitheme;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String createman;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer isenable;
    @Dict(dictName = "WorkflowMob_CodeList56CodeList")
    private String language;
    private Timestamp lastchgpwdtime;
    private Timestamp lastlogintime;
    @TableId(value= "loginaccountid",type=IdType.UUID)//指定主键生成策略
    private String loginaccountid;
    private String loginaccountname;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer orgadmin;
    private String pwd;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer superuser;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String updateman;
    private String userdata;
    private String userdata2;
    private String userdata3;
    private String userdata4;
    private String userid;
    @TableField(exist = false)//逻辑属性
    private String username;
    /**
     *  设置属性值[应用界面主题]
     *  @param appuitheme
     */
    public void setAppuitheme(String appuitheme){
        if(StringUtils.isEmpty(appuitheme))
            appuitheme=null;
        this.appuitheme = appuitheme;
        this.set("appuithemedirtyflag",true);
    }
    /**
     *  获取属性值[应用界面主题]
     */
    public String getAppuitheme(){
        return this.appuitheme;
    }
    /**
     *  重置属性值[应用界面主题]
     */
    public void resetAppuitheme(){
        this.set("appuithemedirtyflag",false);
        this.appuitheme = null;
    }
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[是否启用]
     *  @param isenable
     */
    public void setIsenable(Integer isenable){
        this.isenable = isenable;
        this.set("isenabledirtyflag",true);
    }
    /**
     *  获取属性值[是否启用]
     */
    public Integer getIsenable(){
        return this.isenable;
    }
    /**
     *  重置属性值[是否启用]
     */
    public void resetIsenable(){
        this.set("isenabledirtyflag",false);
        this.isenable = null;
    }
    /**
     *  设置属性值[默认语言]
     *  @param language
     */
    public void setLanguage(String language){
        if(StringUtils.isEmpty(language))
            language=null;
        this.language = language;
        this.set("languagedirtyflag",true);
    }
    /**
     *  获取属性值[默认语言]
     */
    public String getLanguage(){
        return this.language;
    }
    /**
     *  重置属性值[默认语言]
     */
    public void resetLanguage(){
        this.set("languagedirtyflag",false);
        this.language = null;
    }
    /**
     *  设置属性值[最后修改密码时间]
     *  @param lastchgpwdtime
     */
    public void setLastchgpwdtime(Timestamp lastchgpwdtime){
        this.lastchgpwdtime = lastchgpwdtime;
        this.set("lastchgpwdtimedirtyflag",true);
    }
    /**
     *  获取属性值[最后修改密码时间]
     */
    public Timestamp getLastchgpwdtime(){
        return this.lastchgpwdtime;
    }
    /**
     *  重置属性值[最后修改密码时间]
     */
    public void resetLastchgpwdtime(){
        this.set("lastchgpwdtimedirtyflag",false);
        this.lastchgpwdtime = null;
    }
    /**
     *  设置属性值[最后登录时间]
     *  @param lastlogintime
     */
    public void setLastlogintime(Timestamp lastlogintime){
        this.lastlogintime = lastlogintime;
        this.set("lastlogintimedirtyflag",true);
    }
    /**
     *  获取属性值[最后登录时间]
     */
    public Timestamp getLastlogintime(){
        return this.lastlogintime;
    }
    /**
     *  重置属性值[最后登录时间]
     */
    public void resetLastlogintime(){
        this.set("lastlogintimedirtyflag",false);
        this.lastlogintime = null;
    }
    /**
     *  设置属性值[登录帐户标识]
     *  @param loginaccountid
     */
    public void setLoginaccountid(String loginaccountid){
        if(StringUtils.isEmpty(loginaccountid))
            loginaccountid=null;
        this.loginaccountid = loginaccountid;
        this.set("loginaccountiddirtyflag",true);
    }
    /**
     *  获取属性值[登录帐户标识]
     */
    public String getLoginaccountid(){
        return this.loginaccountid;
    }
    /**
     *  重置属性值[登录帐户标识]
     */
    public void resetLoginaccountid(){
        this.set("loginaccountiddirtyflag",false);
        this.loginaccountid = null;
    }
    /**
     *  设置属性值[登录帐户]
     *  @param loginaccountname
     */
    public void setLoginaccountname(String loginaccountname){
        if(StringUtils.isEmpty(loginaccountname))
            loginaccountname=null;
        if(loginaccountname!=null)
        {
    loginaccountname = loginaccountname.toLowerCase();
         }
        this.loginaccountname = loginaccountname;
        this.set("loginaccountnamedirtyflag",true);
    }
    /**
     *  获取属性值[登录帐户]
     */
    public String getLoginaccountname(){
        return this.loginaccountname;
    }
    /**
     *  重置属性值[登录帐户]
     */
    public void resetLoginaccountname(){
        this.set("loginaccountnamedirtyflag",false);
        this.loginaccountname = null;
    }
    /**
     *  设置属性值[机构管理员]
     *  @param orgadmin
     */
    public void setOrgadmin(Integer orgadmin){
        this.orgadmin = orgadmin;
        this.set("orgadmindirtyflag",true);
    }
    /**
     *  获取属性值[机构管理员]
     */
    public Integer getOrgadmin(){
        return this.orgadmin;
    }
    /**
     *  重置属性值[机构管理员]
     */
    public void resetOrgadmin(){
        this.set("orgadmindirtyflag",false);
        this.orgadmin = null;
    }
    /**
     *  设置属性值[登录密码]
     *  @param pwd
     */
    public void setPwd(String pwd){
        if(StringUtils.isEmpty(pwd))
            pwd=null;
        this.pwd = pwd;
        this.set("pwddirtyflag",true);
    }
    /**
     *  获取属性值[登录密码]
     */
    public String getPwd(){
        return this.pwd;
    }
    /**
     *  重置属性值[登录密码]
     */
    public void resetPwd(){
        this.set("pwddirtyflag",false);
        this.pwd = null;
    }
    /**
     *  设置属性值[超级用户]
     *  @param superuser
     */
    public void setSuperuser(Integer superuser){
        this.superuser = superuser;
        this.set("superuserdirtyflag",true);
    }
    /**
     *  获取属性值[超级用户]
     */
    public Integer getSuperuser(){
        return this.superuser;
    }
    /**
     *  重置属性值[超级用户]
     */
    public void resetSuperuser(){
        this.set("superuserdirtyflag",false);
        this.superuser = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
    /**
     *  设置属性值[USERDATA]
     *  @param userdata
     */
    public void setUserdata(String userdata){
        if(StringUtils.isEmpty(userdata))
            userdata=null;
        this.userdata = userdata;
        this.set("userdatadirtyflag",true);
    }
    /**
     *  获取属性值[USERDATA]
     */
    public String getUserdata(){
        return this.userdata;
    }
    /**
     *  重置属性值[USERDATA]
     */
    public void resetUserdata(){
        this.set("userdatadirtyflag",false);
        this.userdata = null;
    }
    /**
     *  设置属性值[USERDATA2]
     *  @param userdata2
     */
    public void setUserdata2(String userdata2){
        if(StringUtils.isEmpty(userdata2))
            userdata2=null;
        this.userdata2 = userdata2;
        this.set("userdata2dirtyflag",true);
    }
    /**
     *  获取属性值[USERDATA2]
     */
    public String getUserdata2(){
        return this.userdata2;
    }
    /**
     *  重置属性值[USERDATA2]
     */
    public void resetUserdata2(){
        this.set("userdata2dirtyflag",false);
        this.userdata2 = null;
    }
    /**
     *  设置属性值[USERDATA3]
     *  @param userdata3
     */
    public void setUserdata3(String userdata3){
        if(StringUtils.isEmpty(userdata3))
            userdata3=null;
        this.userdata3 = userdata3;
        this.set("userdata3dirtyflag",true);
    }
    /**
     *  获取属性值[USERDATA3]
     */
    public String getUserdata3(){
        return this.userdata3;
    }
    /**
     *  重置属性值[USERDATA3]
     */
    public void resetUserdata3(){
        this.set("userdata3dirtyflag",false);
        this.userdata3 = null;
    }
    /**
     *  设置属性值[USERDATA4]
     *  @param userdata4
     */
    public void setUserdata4(String userdata4){
        if(StringUtils.isEmpty(userdata4))
            userdata4=null;
        this.userdata4 = userdata4;
        this.set("userdata4dirtyflag",true);
    }
    /**
     *  获取属性值[USERDATA4]
     */
    public String getUserdata4(){
        return this.userdata4;
    }
    /**
     *  重置属性值[USERDATA4]
     */
    public void resetUserdata4(){
        this.set("userdata4dirtyflag",false);
        this.userdata4 = null;
    }
    /**
     *  设置属性值[用户]
     *  @param userid
     */
    public void setUserid(String userid){
        if(StringUtils.isEmpty(userid))
            userid=null;
        this.userid = userid;
        this.set("useriddirtyflag",true);
    }
    /**
     *  获取属性值[用户]
     */
    public String getUserid(){
        return this.userid;
    }
    /**
     *  重置属性值[用户]
     */
    public void resetUserid(){
        this.set("useriddirtyflag",false);
        this.userid = null;
    }
    /**
     *  设置属性值[用户]
     *  @param username
     */
    public void setUsername(String username){
        if(StringUtils.isEmpty(username))
            username=null;
        this.username = username;
        this.set("usernamedirtyflag",true);
    }
    /**
     *  获取属性值[用户]
     */
    public String getUsername(){
        return this.username;
    }
    /**
     *  重置属性值[用户]
     */
    public void resetUsername(){
        this.set("usernamedirtyflag",false);
        this.username = null;
    }
     /**
     *  获取主实体关联数据[User]
     */
    public User getUser() {
        return user;
    }
    /**
     *  设置主实体关联数据[User]
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetAppuitheme();
        resetCreatedate();
        resetCreateman();
        resetIsenable();
        resetLanguage();
        resetLastchgpwdtime();
        resetLastlogintime();
        resetLoginaccountid();
        resetLoginaccountname();
        resetOrgadmin();
        resetPwd();
        resetSuperuser();
        resetUpdatedate();
        resetUpdateman();
        resetUserdata();
        resetUserdata2();
        resetUserdata3();
        resetUserdata4();
        resetUserid();
        resetUsername();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
	    //随机生成主键
         return  IdWorker.get32UUID();

    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public LoginAccount copyTo(LoginAccount targetEntity)
	{
		BeanCopier copier=BeanCopier.create(LoginAccount.class, LoginAccount.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetLoginaccountid();
		return targetEntity;
	}
}